home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 11
/
Cream of the Crop 11-1.iso
/
games
/
lorri4.zip
/
WORLDDEF.SCR
< prev
next >
Wrap
Text File
|
1995-09-24
|
6KB
|
148 lines
!
! FILE: WORLDDEF.SCR
!
! Entering a world is a complicated sequence of events...
!
! a) It starts when the player decides to ENTER a door, falls
! through a trap-door or somehow enters a door. This happens
! usually in the CONTROL script.
!
! b) The control script uses 'RUNSCRIPT' to execute the world's
! script (WORLDnnn.SCO) if it exists, at entry ponit @EXIT
! to allow that script to handle EXITing the current world.
!
! c) If the WORLDnnn file does not exist, or it exists but
! it ends with CONTINUE instead of STOP, the WORLDDEF
! script is executed (this one) at the @EXIT entry point.
!
! d) This script displays the EXITTEXT associated with the
! door and then calls ENTER() followed by CONTINUE, which
! tells the driver to discard the current world and load
! the new one.
!
! e) The driver discards the current world, loads the new one,
! then:
!
! f) It calls the new world's WORLDnnn script (if it exists)
! at entry point @GET, to allow that script to "interfere"
! with the entry. If this script calls ENTER() or some
! of the other transfers (like TELEPORT()), the new world
! will be loaded and it's @GET script called, until one of
! scripts ends without calling ENTER, etc.
! NOTE THAT THE OLD WORLD, WHILE NO LONGER LOADED, IS STILL
! DISPLAYED IN THE VIEW PORT. THE PLAYER HAS NOT SEEN THE
! DESTINATION WORLD AT THIS POINT.
!
! g) If the previous script didn't exist or it ended with
! CONTINUE (but without calling ENTER, etc.) the WORLDDEF
! script is called to handle the transfer in the @GET entry
! point. This default script doesn't do anything with
! that call. It just 'CONTINUE's.
!
! h) THE DRIVER NOW DISPLAYS THE NEW WORLD IN THE VIEWPORT.
!
! i) Now the driver calls the WORLDnnn script at entry point
! @ENTER.
!
! j) If the above script ends with CONTINUE on the second call,
! or the script does not exist at all, then the default script
! (WORLDDEF) is called with entry pont @ENTER.
!
! NOTES:
!
! 1) The main purpose of the @GET entry point is to allow you to 'catch'
! the player BEFORE the new world is displayed. The main reason for
! this is that you may want to transfer the party to a 3rd destination
! upon certain conditions. Should you perform a transfer in the @ENTER
! section, the new world would 'blink' on the screen, before the party
! is transfered. This MAY very well be what you want to do, for example
! if you display some text or do some animation that shows the reason
! why the final destination will be different!.
!
! (c) DC Software, 1995
!
!------------------------------------------------------------------------!
:@GET ! CALLED FROM THE DRIVER BEFORE THE NEW WORLD IS LOADED
!------------------------------------------------------------------------!
L1 = group.current;
group.current = 0;
if player.level < world.level then
group.current = L1;
writeln( "You are not experienced enough to go in there.." );
enter(world.door); ! Go back the way we came.. !
stop;
endif;
group.current = L1;
continue;
!------------------------------------------------------------------------!
:@ENTER ! CALLED FROM THE DRIVER AFTER THE WORLD IS "displayed"
!------------------------------------------------------------------------!
L0 = 0;
if world.entrytext(world.door) > 0 then
readtext( world.entrytext(world.door) );
! if the switch is zero, the text is displayed only once !
if world.entrytextswitch(world.door) = 0 then
world.entrytext(world.door) = -1; ! Forget the text !
endif;
L0 = 1; ! Text has been displayed !
endif;
! For compatibility with version 1.0 and 2.0, handle the end-game flag !
if world.type = ENDGAME then
writeln( "Press <SPACE> to end game" );
pause; ! Wait before ending the game !
ENDGAME;
endif;
if L0 = 0 then
writeln( "You are now in ", world.name );
endif;
if world.type = ARENA then
! Create a RANDOM monster in the center of this world !
L2 = random(3); ! SIZE 0=Small, 1=Medium, 2=Large
L3 = random(L2+3); ! Tile # 0-2, 1-3 or 2-4 !
new( npc, world.x / 2, world.y / 2, defcaveblk(L3) );
npc.type = HOSTILE; ! NPC Type
npc.stats = defstat(CAVE_MONSTER); ! Statistics Record
npc.class = CAVE_MONSTER; ! Monster Class
npc.block2 = npc.block; ! Followers are the same tile..
npc.value = 0; ! No money;
!
! # of monsters in the group. The formula is based on L2 (monster size).
! If small (L2=0), then # = random( group.size + 6 ) + 1
! If medium (L2=1), then # = random( group.size + 3 ) + 1
! if large (L2=2), then # = random( group.size ) + 1
npc.count = random( group.size + (2 - L2) * 3 ) + 1;
endif;
STOP; ! Ok. We have 'entered' the world !
!------------------------------------------------------------------------!
:@EXIT ! CALLED FOR THE CURRENT WORLD BY THE CONTROL SCRIPT
!------------------------------------------------------------------------!
! Handle exit text if any !
if world.exittext(world.door) >= 0 then
readtext( world.exittext(world.door) );
if world.exittextswitch(world.door) then
world.exittext(world.door) = -1; ! Never Again.. !
endif;
endif;
! If it's OK to exit the current world through the
! door indicated here, you go ahead and issue the
! ENTER() command followed by CONTINUE to tell the
! driver to go ahead and load the next world !
enter( world.door );
CONTINUE;
! if you wanted to prevent someone from taking this
! door, you would not call ENTER and would call
! STOP to finish this script